﻿namespace Core.Domain.ValueObjects;

public record PhoneNumber
{
    public string Value { get; }

    public PhoneNumber()
    {
        Value = "";
    }

    public PhoneNumber(string value)
    {
        if (string.IsNullOrWhiteSpace(value))
            throw new BoilerplateException("手机号不能为空");
        Value = value;
    }

    public static implicit operator string(PhoneNumber number) => number.Value;
}
